<template>
	<view class="container">
		<cu-header bgColor="bg-gradual-blue" :isBack="true">
			<block slot="content" class="page-name">订单列表</block>
		</cu-header>
		<cu-tabbar :current="current" :datas="tabs" @onchange="onSwitchTab"></cu-tabbar>
		<scroll-view class="contents" scroll-y scroll-with-animation style="height:calc(100vh - 175upx)">
			<cu-list-order :datas="lists" @onchange="onSelect"></cu-list-order>
			<cu-more title="已没有更多内容咯"></cu-more>
		</scroll-view>
		
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	import cuListOrder from '@/components/diy/list/cu-list-order.vue';
	import cuTabbar from '@/components/diy/header/cu-tabbar.vue';
	export default {
		computed: {
			...mapState(['hasLogin', 'forcedLogin', 'userinfo'])
		},
		components: {
			cuListOrder,
			cuTabbar
		},
		data() {
			return {
				current:0,
				lists: [{
						name: '以纯',
						status: 1,
						goods: [{
							name: "时尚运动鞋",
							price: 150,
							number: 2,
							image: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg'
						},
						{
							name: "运动套装",
							price: 280,
							number: 2,
							image: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg'
						}]
					},
					{
						name: '美特斯邦威',
						status: 1,
						goods: [{
							name: "夏季时尚短袖",
							price: 150,
							number: 2,
							image: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg'
						}]
					},
					{
							name: '李宁',
							status: 1,
							goods: [{
								name: "男鞋2021新款网面沙滩鞋",
								price: 150,
								number: 2,
								image: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg'
							}]
						}
				],
				tabs: [{
				
						name: '待付款',
						color: 'red'
						
					},
					{
				
						name: '待发货',
						color: 'red'
					
					},
					{
				
						name: '待收货',
						color: 'red'
					
					},
					{
				
						name: '待评价',
						color: 'red'
						
					},
					{
				
						name: '已完成',
						color: 'red'
						
					}
				]
			};
		},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function(res) {
			if (res.from === 'button') {
				// 来自页面内分享按钮
				console.log(res.target);
			}
			return this.shareinfo;
		},
		onLoad(prop) {
			console.log(prop);
			if(prop.type){
				this.current=prop.type;
			}
		},
		onShow() {
			
		},
		methods: {
			...mapMutations(['logout', 'login', 'loginsoure']),
			onSelect: function(e) {
				this.$util.redirectTo('/pages/shop/order/details')
			},
			onSwitchTab:function(e){
				console.log(e);
			}

		}
	};
</script>

<style scoped></style>
